﻿using UnityEngine;
using System.Collections;
#if UNITY_EDITOR
using UnityEditor;
#endif

public class testEditor2 : testEditor
{
    string str2 = "b";

    public void setStr2(string str)
    {
        str2 = str;
    }

    public string getStr2()
    {
        return str2;
    }

    void Update()
    {
        if (int1 >= 1f)
        {
            Debug.Log("222222====="+str2+"===="+str1);
            int1 = 0f;
        }
        int1 += Time.deltaTime;
    }

}

#if UNITY_EDITOR
[CustomEditor(typeof(testEditor2))]
[CanEditMultipleObjects]
public class MyEditor2 : MyEditor
{


    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        serializedObject.Update();
        //得到Test对象
        testEditor2 test = (testEditor2)target;

        //绘制一个窗口
        test.setStr2(EditorGUILayout.TextField(new GUIContent("str2"), test.getStr2()));


    }
}
#endif
